﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Ue.CQRS.Events
{
    public class EventFactory
    {
        public static IEvent Build(IEventBuilder builder, EventAttribute eventAttribute, object sender, object eventArgs)
        {
            if (builder == null)
            {
                return EventFactory.Build(eventAttribute, sender, eventArgs);
            }

            return builder.Build(eventAttribute, sender, eventArgs);
        }
        public static IEvent Build(EventAttribute eventAttribute,object sender,object eventArgs)
        {
            return EventFactory.Build(new DomainEventBuilder(),eventAttribute, sender, eventArgs);
        }
    }
}
